var schoolUrl = '/pvm/school/getSchoolList';

var nameCheck = (rule, value, callback) => {
  let namereg=/^\S+$/
    if(!namereg.test(value)){
      callback(new Error('不允许有空格'))
    }else{
      callback()
    }
};

export const tableOption = {
  "border": true,
  "index": true,
  "indexLabel": "序号",
  "stripe": true,
  "menuAlign": "center",
  "align": "center",
  "column": [
	  {
      "type": "input",
      "label": "部门编号",
      "prop": "id",
      hide: true,
      addDisplay: false,
      editDisabled: true
    },	  {
      "type": "input",
      "label": "部门名称",
      "prop": "deptName",
      search: true,
      rules: [{
        required: true,
        message: '请输入部门名称',
        trigger: 'blur'
      },
        {validator: nameCheck, trigger: 'blur'}
      ],
    },	  {
      "type": "input",
      "label": "部门职责",
      "prop": "responsibility"
    },	  {
      "type": "select",
      "label": "学校编号",
      "prop": "schoolId",
      search:true,
      props: {
        label: 'schoolName',
        value: 'id'
      },
      dicUrl: `${schoolUrl}`
    },	  {
      "type": "input",
      "label": "删除标记",//1为未删除,-1为删除
      "prop": "delFlag",
      hide: true,
      addDisplay: false,
      editDisplay: false
    },	  {
      "type": "input",
      "label": "创建时间",
      "prop": "createTime",
      addDisplay: false,
      hide: true,
      editDisplay: false
    },	  {
      "type": "input",
      "label": "创建人",
      "prop": "createUser",
      addDisplay: false,
      editDisplay: false
    },	  {
      "type": "input",
      "label": "修改时间",
      "prop": "updateTime",
      addDisplay: false,
      hide: true,
      editDisplay: false
    },	  {
      "type": "input",
      "label": "修改人",
      "prop": "updateUser",
      addDisplay: false,
      hide: true,
      editDisplay: false
    }  ]
}
